package com.jfinal.aceadmin.controller;

import java.util.List;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

public class DbProjectController extends Controller{
	
	public void dbProject(){
		
		//查询在途项目
		List<Record> onRoadProjectList = Db.find("select 项目编码,企业名称,项目管理状态,业务品种,期限,担保金额,责任A角,责任部门,上会通过月份 from queryProjectInfoForStatistics_Chinese where 申请日期>='2015-01-01' and 项目管理状态 like '%[1,2,3,4,5]%' order by 上会通过月份 desc ");
		
		setAttr("onRoadProjectList", onRoadProjectList);
		
		
		//分页查询在途项目列表
		Page<Record> onRoadProjectPage = Db.paginate(1, 10, "select 项目编码,企业名称,项目管理状态,业务品种,期限,担保金额,责任A角,责任部门,上会通过月份 ", "from queryProjectInfoForStatistics_Chinese where 申请日期>='2015-01-01' and 项目管理状态 like '%[1,2,3,4,5]%' order by 上会通过月份 desc");
		

		setAttr("onRoadProjectPage", onRoadProjectPage);
		
		
		//查询在保项目
		List<Record> onGuaranteeList = Db.find("select 项目编码,企业名称,业务品种,放款金额,放款日期,还款到期日,(应在保余额-在保余额) as 差额  from queryProjectInfoForStatistics_Chinese where 还款到期日>=GETDATE() order by 放款日期 desc");
		
		setAttr("onGuaranteeList", onGuaranteeList);
		
		
		render("dbProject.html");
	}

}
